Monad Transformers as Monoid Transformers
نویسنده
چکیده
The incremental approach to modular monadic semantics constructs complex monads by using monad transformers to add computational features to a preexisting monad. A complication of this approach is that the operations associated to the pre-existing monad need to be lifted to the new monad. In a companion paper by Jaskelioff, the lifting problem has been addressed in the setting of system Fω. Here, we recast and extend those results in a category-theoretic setting. We abstract and generalize from monads to monoids (in a monoidal category), and from monad transformers to monoid transformers. The generalization brings more simplicity and clarity, and opens the way for lifting of operations with applicability beyond monads.
منابع مشابه
Eilenberg-Moore Monoids and Backtracking Monad Transformers
We develop an algebraic underpinning of backtracking monad transformers in the general setting of monoidal categories. As our main technical device, we introduce Eilenberg–Moore monoids, which combine monoids with algebras for strong monads. We show that Eilenberg–Moore monoids coincide with algebras for the list monad transformer (‘done right’) known from Haskell libraries. From this, we obtai...
متن کاملBuilding inference algorithms from monad transformers
We show how to decompose popular inference algorithms into a set of simple, reusable building blocks corresponding to monad transformers. We define a collection of such building blocks and implement them in Haskell producing a library for constructing inference algorithms in a modular fashion. We are also working towards formalizing those concepts as monadic denotational semantics for inference...
متن کاملModular Monad Transformers
During the last two decades, monads have become an indispensable tool for structuring functional programs with computational effects. In this setting, the mathematical notion of a monad is extended with operations that allow programmers to manipulate these effects. When several effects are involved, monad transformers can be used to build up the required monad one effect at a time. Although thi...
متن کاملTowards a Denotational Semantics for Concurrent State Transformers
Concurrent state transformers are an extension of state transformers investigated by Launchbury, Peyton Jones, Wadler, and others by concurrency primitives. A denotational semantics for state transformers executing in parallel is deened using standard domain theoretic techniques. Using the semantics it is proved that concurrent state transformers still form a monad and that the concurrent seman...
متن کاملReusable Metatheory for Program Analysis
The design and implementation of static analyzers have becoming increasingly systematic. In fact, for large classes of analyzers, design and implementation have remained seemingly (and now stubbornly) on the verge of full mechanization for several years. A stumbling block in full mechanization has been the ad hoc nature of soundness proofs accompanying each analyzer. While design and implementa...
متن کامل